package office.action.hr;

import java.util.List;
import office.action.hr.form.CheckIdeaForm;
import office.service.hr.ICheckIdeaService;
import platform.common.action.BaseAction;

public class CheckIdeaAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private CheckIdeaForm checkIdeaForm;
	private ICheckIdeaService checkIdeaService;
	@SuppressWarnings("unchecked")
	private List checkIdeaList;
	private String checkFolwId;
	
	/**
	 * 初始化填写审批意见
	 * @return
	 * @throws Exception
	 */
	public String gotoCheckIdea()throws Exception{
		return "gotoCheckIdea";
	}
	/**
	 * 保存审批意见
	 * @return
	 * @throws Exception
	 */
	public String saveCheckIdea()throws Exception{
		try {
			String userId = getUserId();
			checkIdeaForm.setCheckUserId(userId);
			checkIdeaService.saveCheckIdea(checkIdeaForm);
			this.getAjaxMessagesJson().setMessage(true, "", "审批意见保存成功");
		} catch (Exception e) {
			this.handleException(e);
		}
		return RESULT_AJAXJSON;
	}
	/**
	 * 获取某个审批对象的审批意见
	 * @return
	 * @throws Exception
	 */
	public String getByCheckFolwId()throws Exception{
		try {
			checkIdeaList = checkIdeaService.getByCheckFolwId(checkFolwId);
		} catch (Exception e) {
			this.handleException(e);
		}
		return "checkIdeaList";
	}

	public CheckIdeaForm getCheckIdeaForm() {
		return checkIdeaForm;
	}

	public void setCheckIdeaForm(CheckIdeaForm checkIdeaForm) {
		this.checkIdeaForm = checkIdeaForm;
	}

	public ICheckIdeaService getCheckIdeaService() {
		return checkIdeaService;
	}

	public void setCheckIdeaService(ICheckIdeaService checkIdeaService) {
		this.checkIdeaService = checkIdeaService;
	}
	@SuppressWarnings("unchecked")
	public List getCheckIdeaList() {
		return checkIdeaList;
	}
	@SuppressWarnings("unchecked")
	public void setCheckIdeaList(List checkIdeaList) {
		this.checkIdeaList = checkIdeaList;
	}
	public String getCheckFolwId() {
		return checkFolwId;
	}
	public void setCheckFolwId(String checkFolwId) {
		this.checkFolwId = checkFolwId;
	}
	
}
